<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>发送端</title>
   <@header/>
</head>
<body>
<form class="layui-form" action="">
    <div class="layui-form-item">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-block">
            <input type="text" name="title" required  lay-verify="required" placeholder="请输入标题" autocomplete="off" class="layui-input">
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">来源</label>
        <div class="layui-input-block">
            <input type="text" name="origin" required  lay-verify="required" placeholder="请输入来源" autocomplete="off" class="layui-input">
        </div>
    </div>

    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">请输入内容</label>
        <div class="layui-input-block">
            <textarea name="content" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="formDemo">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
</form>

<script>
    //Demo

    var obj={
        "inserttasks": [
            {
                "app_id": "456",
                "task_id": "789",
                "created_by_ids": "678,756",
                "created_by_names": "张三,李四",
                "created_by_depts": "教务处,学工处",
                "subject": "新进教职工卓长飞已经上传一寸照",
                "created_on": "2016-3-16 22:17:20:445",
                "end_on": "",
                "actual_owner_id": "",
                "actual_owner_name": "",
                "actual_owner_dept": "",
                "form_url": "http://wisebpm.com/form1.jsp",
                "form_url_view": "http://wisebpm.com/form1_view.jsp?id=123",
                "priority": "1",
                "task_comment": "同意通过",
                "biz_group_id": "",
                "biz_task_status": "",
                "biz_key": "",
                "biz_domain": "oa",
                "biz_domain_subtype": "公文",
                "node_name": "发文",
                "node_id": "23423",
                "status": "ACTIVE",
                "is_merge_task": "0",
                "merge_num": "",
                "biz_task_status ": "",
                "biz_group_id ": "",
                "delete_flag": "0",
                "last_task_status": "",
                "distribute": "",
                "process_instance_id": "34234",
                "process_instance_initiator_id": "1341234231",
                "process_instance_initiator": "张三",
                "process_instance_initiator_dp": "学工处",
                "instance_initiator_dpid": "C01",
                "process_instance_status": "running",
                "process_instance_start_date": "2016-3-16 22:17:20:445",
                "process_instance_ent_date": "",
                "process_instance_image_url": "http://wisebpm.com/image.jsp?processinstanceid=456",
                "process_instance_subject": "张三的发文流程",
                "process_instance_form": "http://wisebpm.com/image.jsp?processinstanceid=456",
                "process_instance_form_view": "http://wisebpm.com/image.jsp?processinstanceid=456",
                "process_id": "23123",
                "process_name": "发文",
                "process_source": "一表通平台",
                "process_version": "1",
                "assignments": [
                    {
                        "assign_id": "2009058",
                        "assign_name": "user1",
                        "assign_dept": "学工处"
                    },
                    {
                        "assign_id": "200000000",
                        "assign_name": "user2",
                        "assign_dept": "学工处"
                    },
                    {
                        "assign_id": "30000",
                        "assign_name": "user3",
                        "assign_dept": "学工处"
                    }
                ]
            }
        ],
        "updatetasks": [
            {
                "app_id": "456",
                "task_id": "789",
                "created_by_ids": "678,756",
                "created_by_names": "张三,李四",
                "created_by_depts": "教务处,学工处",
                "subject": "新进教职工卓长飞已经上传一寸照",
                "created_on": "2016-3-16 22:17:20:445",
                "end_on": "",
                "actual_owner_id": "333",
                "actual_owner_name": "user22",
                "actual_owner_dept": "教务处",
                "process_name": "发文",
                "process_version": "1",
                "operate_on": "",
                "operator_id": "",
                "operator_name": "",
                "operator_dept": "",
                "operate_type": "",
                "assignments": [
                    {
                        "assign_id": "2009058",
                        "assign_name": "user1",
                        "assign_dept": "学工处"
                    },
                    {
                        "assign_id": "200000000",
                        "assign_name": "user2",
                        "assign_dept": "学工处"
                    },
                    {
                        "assign_id": "30000",
                        "assign_name": "user3",
                        "assign_dept": "学工处"
                    }
                ]

            }
        ]
    };


    layui.use('form', function(){
        var form = layui.form;

        //监听提交
        form.on('submit(formDemo)', function(data){
           // layer.msg(JSON.stringify(data.field));
            $.ajax({
               contentType: 'application/json;charset=UTF-8',
                type: "POST",
                url: "<@path/>/submit",
               data: JSON.stringify(data.field),
               dataType: "json",
            });
            return false;
        });
    });
</script>
</body>
</html>